4. generic device 4
所以到目前为止,我们已经能够骑到我们的通用设备的主要组件,因此我们滚动了实际的耻辱机器,这是通用设备的核心。
So up to now, we have been able to ride to the main components of our generic device, so we rolled the actual stigma's machine, that is the core of the generic device.
我们编写了反馈映射和执行器映射。
We wrote the feedback mapping and the actuator mapping.
因此,现在,我们准备在该项目中拥有的实际设备上测试此实现,以查看一切是否正常工作,并且我们能够设法处理具有相同功能块的不同类型的设备。
So right now, we are ready to test this implementation on the actual devices that we have in this project in order to see if everything works correctly and we are able to manage to handle different kinds of devices with the same functional block.
那么让我们来看看第二个全局变量。
So let's go over here to the global variables with second.
我将首先关闭所有已打开的 EDS,然后尝试创建我们的设备。
I will first close all the EDS that I have opened and let's try to create our devices.
让我们回到主程序,取消我们创建的通用设备和设备调用。
Let's go back to our main program and let's cancel the generic device and the device call we created.
现在让我们尝试创建我们的功能块,这样我们就有了活塞。
So let's now try to create our function blocks so we will have our piston one.
让我们根据一个类型尝试一下,类型是 F.P.
Let's try this like this based on one and the type is F.P.
下划线与通用设备相同。
underscore a generic device and the same.
我们将对所有其他活塞进行相同的处理。
We will have the same for all the other pistons.
所以我可以简单地以这种方式复制和粘贴并粘贴七次。
And so I can simply copy and paste in this way and paste this seven times.
并彻底改变活塞队的名称。
And radically change the name of the Pistons.
因此,我们将拥有所有这些不同的活塞,同一功能块的不同实例。
So we will have all these different pistons, different instances of the same function block.
现在,让我们把这个全局变量列表放在这里,这样我们就可以直接看到活塞和我们在这里拥有的类型。
So right now, let's take this global variable list over here so we can directly see the Pistons and the types that we have over here.
因此,让我们继续使用通用设备,调用并为每个活塞插入一个网络调用。
So let's move on to our generic devices, call and let's insert a network call for each piston.
所以在这里,我将首先插入一个空盒子。
So over here, I will first insert an empty box.
这将是我们的活塞,我将删除这里所有的问号,以便能够正确设置它。
This will be our piston one and I will delete all the question marks over here in order to be able to set it correctly.
我还将在第一个输出引脚上添加一个分配。
I will also add an assignment on the first output pin.
后来,又是问号。
And later, again, the question marks.
好的,让我们处理第一个活塞。
OK, so let's handle the first piston.
第一个活塞是单次致动,无反馈。
The first piston is a single actuation, no feedback.
所以在这里我不会有反馈,没有传感器。
So over here I will have no feedback, no sensors.
在反馈类型中。
In the feedback type.
我们不需要编写任何反馈,并且在激活类型中我们将编写单个激活。
We will need to write no feedback and in the activation type we will write a single activation.
如果按控制空格,您将看到它将以这种格式写入实际枚举值和实际类型点值。
If you press control space, you will see that it will write the actual enumerated value with the actual type dot value in this format.
没事。
It is fine.
它的工作原理完全相同。
It works exactly in the same way.
我在这里也可以做同样的事情。
I can do the same over here.
写这个其实没有什么区别。
There is actually no no difference in writing this.
这是因为我们在这里删除了限定的 only 属性。
And this is because we removed the qualified only attribute over here.
如果我们这样做,我们会通过编写简单的内部反馈得到错误。
If we did that, we would get an error by writing simple internal feedback.
所以这其实是一样的。
So this is actually the same.
我将取消此操作以便获得更紧凑的视图。
I will cancel this in order to have a more compact view.
因此,继续,我们需要根据活塞队的运作情况骑行到这里并激活时间。
So moving on, we will need to ride over here and activation time according to the functioning of the Pistons.
我们可以简单地骑车到这里。
We can simply ride over here.
我们看看激活时间和激活时间都是两秒到两秒。
Let's see two seconds to two seconds in both the activation and the activation time.
我们需要将执行器连接到这里,因此将控制这个人的实际输出,即活塞活塞。
We will need to link over here the actuator, so the actual output that will control the person that is this one, the piston piston one common.
我们快完成了。
And we are almost done.
我们需要在此处链接实际的物理按钮,该按钮由此处的变量给出。
I we need to link the actual physical button over here and this button is given by the variable over here.
Beston 一个,嗯,设备就属于这个。
Beston one, um, device come under that.
这实际上将链接到设备命令和活塞一功能块。
And this will be actually linked to the device command and the piston one function block.
所以我复制并粘贴到这里。
So I copied and pasted over here.
我们快完成了。
We are almost done.
我还添加了一个设备来状态每个活塞的变量,因此我们将能够在可视化中显示它。
I also added a device to state variables for each piston, so we will be able to display this on the visualisation.
所以我会把它放在这里。
So I will place this here.
也因为它是,呃,您也总是需要在功能块的输出上使用此设备数据,因为它非常有用,而且它实际上是您对设备状态的反馈。
And also because it is, uh, you will also always need this device data on the output of the function block because it where it is very useful and it is actually your feedback on the state of the device.
我们需要的最后一件事就是在此处放置,以使设备始终处于启用状态。
And the last thing we need is to place through over here in order to have the device always enabled.
这样我们就完成了第一个设备、第一个活塞。
So we are done for the first device, for the first piston.
让我们计算、复制和粘贴这个网络,就像复制和粘贴这个网络一样,以便拥有两个不同的另一个网络。
Let's count, copy and paste this network like copy and paste this in order to have two different another network.
让我们对第二个活塞做同样的事情。
And let's do the same for the second piston.
第二个活塞是单一的,呃,致动,并且具有单一启用的费尔贝克。
The second piston is a single, uh, actuation and with a single enabled felbeck.
那我们就到这里换一下吧。
So let's change over here.
功能块的名称为活塞二,我们还可以更改所有输入、变量和输出。
The name of the function block to piston two and the let's also change all the input and variable and outputs.
您有活塞设备来,活塞设备状态和活塞命令。
You have Pistons device come and piston to device state and piston to command.
我们还必须更改这里的反馈类型。
We also have to change the feedback type over here.
我们有一个启用的反馈,对于这种活塞装置,我们需要实际将传感器放在这里,并且初始传感器的感觉是这个实质性的正限制,我将放置这个争议并控制它。
We have a single enabled feedback and for this kind of piston device, we need to actually place the sensor over here and the sense the initial sensor is this substantial positive limit and I will place this controversy and control it.
好的,第二个活塞没问题,让我们通过复制和粘贴网络再次移动到第三个活塞。
OK, the second piston is OK, let's move to the third one again with a copy and paste of the network.
我们将拥有三号活塞,让我们将所有东西都改为三号,就像我们将拥有三号活塞设备和三号活塞一样。
We will have Piston three and let's change to three everything like we will have piston three devices come and piston three.
过来吧。
Come on over here.
活塞三号,副那个。
Piston three, the vice thate.
我们希望有一个正限制或启用的传感器,因为这是单个 Decebal 反馈。
We want to have a positive limit or an enabled sensor because this is a single Decebal feedback.
我们可以先在这里写下这些人。
We can start by writing this here single these people here back.
最后一件事是我们需要将禁用反馈放入正确的输入中。
And the last thing is that we need to place the disable feedback in the correct input.
反馈是活塞三负极限,这对于我们的活塞树来说是向下的。
The feedback is this piston three negative limit and this is down for our piston tree.
让我们继续第四个。
Let's move on to the fourth.
我们的第四个活塞是双反馈活塞,所以我们可以从这里开始写。
Our fourth piston is double feedback pistons so we can start by writing this over here.
双重反馈。
Double feedback.
我们需要将所有内容从三个更改为四个。
We will need to change everything from three to four.
在每个输入和输出上。
On every input and output.
我们在这里,然后我们还将有一个和平条约,消极和平限制和消极拉梅特的消极主义,以及和平积极限制和积极限制。
We're here, then we will have also a peace treaty, negativism for negative limits of peace and for negative lamet, as well as a positive limit so of peace and for positive limit.
好的,我们成功实例化了对活塞的调用。
OK, we managed to instantiating call for Piston's.
让我们继续讨论最后三个。
Let's move on to the last three.
让我们三个双驱动。
Let us three our double actuation.
因此,第一个、第五个是双驱动、单启用反馈,因此我们实际上可以将单驱动单启用反馈复制到此处并进行修改。
So the first one, the fifth one is a double actuation, single enabled feedback so we can actually copy the single actuation single enabled feedback over here and modify it.
所以这里我们是一个活塞。
So here we are a piston.
当然。
Sure.
让我们复制并粘贴它并将其更改为活塞五。
Let's copy this and paste this and change it to Piston five.
我们将再次听到Beston 5、Beston 5,我们需要改变我们实际上有双驱动的事实。
We will have again, we hear Beston five, Beston five again, we need to change the fact that we have actually a double actuation.
我们即将推出活塞五号。
Here we have a Piston five coming up.
抱歉,这不正确,因为我们有两次激活。
Sorry, this is not correct, because we have two activations.
正如你在这里看到的,我们有一支手枪,五支在前,活塞五支在后。
So as you can see here, we have a pistol, five coming forward and the piston five come on backward.
所以我将直接骑着这个五号活塞在启用的设备执行器上向前行驶,然后五号活塞来,来,然后向后。
So I will directly ride this Piston five coming forward on the enabled device actuator and Piston five, come, come and backward.
我只需要在这里改变一下。
I just need to change over here.
活塞五队、Baystate 和我们都已经结束了。
The Piston five, the Baystate and we are done with this.
我们继续看第六个。
Let's move on to the sixth one.
第六个是双重驱动,单一可见反馈。
The sixth one is a double actuation, a single visible feeback.
因此,我们将在这里得到一个可见的反馈,并且我们将希望拥有一个启用的传感器。
So we will have over here a single visible feedback and we will have we will want to have an enabled sensor.
我们将有一个禁用的传感器。
We will have a disabled sensor.
所以活塞六负极限就在这里。
So piston six negative limit here.
一样的东西。
The same thing.
活塞六号,最常见。
Pistons six, the most common.
活塞六队,上前,活塞六队。
Pistons six, come on forward, Pistons six.
回来吧,活塞队按州分六队,好吧,我们已经完成了第六队。
Come backward and pistons six by state, OK, we're done with the sixth one.
这是最后一台,我们将在活塞七号装置中拥有七台。
This is the last one, seven one we will have over here at Pistons seven device.
快点。
Come on.
我们将有正向和负向限制。
We will have both positive and negative limit.
现在,活塞七人,就是那一倍了。
Now, the Pistons seven, is that double the.
抱歉,这是错误的。
Sorry, this is wrong.
哦,正确。
Oh, correct.
这是双重反馈。
This this is double feedback.
我们有双驱动、双反馈。
We have double actuation, double feedback's.
所以这是最完整的活塞。
So this is the most complete piston.
活塞七负限制,我将复制此内容并将其拼凑到活塞七正上。
Pistons seven negative limit, I will copy this and piece this over here over Pistons seven positive.
抱歉,帕尔小姐,这将是一个双重反馈,在这里我们再次从六到七的变化,百分之六到百分之七的速度和百分之七的落后。
Limit sorry, Miss Pal, this one, this will be a double feedback, and over here we are again of the change from six to seven, six to seven percent pace and seven come on backward.
还有活塞队的七号队,Baystate。
And Piston's seven, the Baystate.
好的,当我们调用每个功能块时,我们实际上完成了,我们调用了操作,这样我们就可以构建一个外观,看看是否有任何错误。
OK, so we actually finished when we made the call to every function block, we made the call to the action so we can build a look, see if there are any errors.
我们只有一个错误,但这是关于可视化的,所以没什么好担心的。
We have just this one error, but this is about visualisations, so this is nothing to worry about.
我们可以简单地最新并构建它。
We can simply latest and going to build it.
我们可以看到账单上没有错误。
We can see in the bill that we have no error.
现在,我们可以上网查看可视化效果,所以我可以说我们将关闭全局变量列表并执行下载。
And right now, we can go online looking at the visualisations so I can say we will close the global variable list and carry out a download the.
让我们从 p.l.c. 开始。
And let's start with the p.l.c..
现在我们可以测试所有七个活塞,看看它们的表现如何。
And now we can test all the seven Pistons to see how they behave.
让我们从第一个开始,单击“启用”。
Let's start with the first one by clicking on enable.
您可以看到这就是它工作得很好的地方。
You can see that is where it is working quite fine.
您还可以在这里获得有关该州的反馈。
You also have a feedback on the state over here.
因此,如果我单击“Able Person”,您将看到方程变为绿色,状态进入启用状态,然后由计时器在我们保留功能块的两秒内执行启用到启用的转换。
So if I click on Able Person, you will see the equation become green and the state goes into enabling and then enable the transition to the enabled is carried out by the timer, by the two seconds that we were retain the function block.
如果我移除启用的活塞,我们就会出发。
If I remove the enabled piston, we will go.
这将变成红色,我们将进入禁用状态,然后进入禁用状态。
This will become red and we will get the to the disabling state and then to the disabled state.
让我们转向第二个,第二个的工作方式相同。
Let's move to the second one, the second one works in the same way.
唯一的区别是,向 ANÍBAL 州的过渡是通过本次人口普查完成的。
The only difference is that the transition to the ANÍBAL state is done by the means of this of this census.
因此,您会看到当反馈到来时它实际上会转换到启用状态。
So you will see that it will actually transition to the enable state when the feedback comes comes in.
所以现在,我们实际上还没有对系统进行全面的诊断,你可以看到,如果我按下这个红色按钮,我将强制启用反馈为假。
So right now, we haven't actually carried out the full diagnosis of the system and you can see if I press this red button, I will force the enable feedback to false.
如果我启用活塞,您可以看到状态未启用,因为我们仍在等待该传感器。
And if I enable the piston, you can see that the state does not get to enable because we are still waiting for this sensor.
稍后,我们将使用这些信息、时间或信息来实际检测该传感器上的故障。
Later on, we will use this information, the time or information to actually detect a fault on this sensor.
因此,如果我移除此力,我们将看到它变为绿色并且我们获得启用状态。
So if I remove this force, we will see that this becomes green and we get the enable state.
对于禁用的情况也是如此,但是您可以看到到启用的转换是由计时器执行的。
The same goes on for the disabled, but you can see that the transition to enable is carried out by a timer.
到禁用的转换由传感器执行。
The transition to disabled is carried out by the sensor.
这里我们有一个双驱动,抱歉,单驱动,双反馈,在这里你可以看到状态的转换实际上只是通过传感器完成的。
Here we have a double actuation, sorry, a single actuation, double feedback, and over here you can see that the transition to the state is actually only done by the means of the sensors.
计时器实际上对于功能来说并不重要。
And the timers do not actually matter for the functioning.
它们对于前向检测很重要。
They will matter for the forward detection.
好的,那么让我们继续第五个中的第五个。
OK, so let's move on to the fifth one in the fifth one.
我们有两个激活,您将在这里看到它们实际上是根据它们所处的阶段以连贯的方式打开的。
We have two activations and we will you will see over here that they are actually turned on in a coherent way according to the to the phase they were they are in.
因此,当它们需要再次移动时,将以与单次激活相同的方式处理反馈。
So just when they need to be moved again, the feedback are handled in the same way of the single activations.
所以你可以看到,如果我们处于禁用状态或不可识别状态,这两者都会与等力保持在一起。
So you can see that the if we are in the disabled state or indiscernible state, both of this will stay with the with the equal to force.
相反,当他们启用或禁用一项时,只有一个激活回合变为绿色。
Instead, when they are enabling or disabling one only one activation turn that is turned green.
第六个状态也是如此,其中通过计时器执行到真状态的转换,通过传感器执行到禁用状态的转换,最后一个状态是在七周内。
The same goes for the sixth one where the transition to true is carried out with the timer and the transition to the disabled state is carried out with the sensor and for the last one is in seven weeks.
同样,向禁用、禁用和状态的转变都是通过传感器来实现的。
In the same way, the transition to the disabled, the disabled and the state are both carried out by the means of the sensors.
因此,这是我们可以拥有的最完整的设备,具有实际的反馈和激活功能。
So this is the most complete device we can have with the actual with feedbacks and activations.
因此,我们实际上设法实现了一个可与所有这些设备以及所有这些不同设备一起使用的功能块。
So we actually managed to implement a function block that works with all of these devices, with all these kind of different devices.
这是一个非常强大的工具,而且非常有用。
This is a very powerful tool and this is very useful.
创建一个具有高度模块化和模块化的机器在某种意义上是非常有用的,因为如果你改变一个设备,你只需要改变这里的几个参数。
To create a machine with a high degree of modularity and modularity in the sense is very useful, because if you change a device, you simply need to change a few parameters over here.
假设您使用的是机器的第一个版本。
Let's say that you are in your first version of a machine.
您使用的是没有反馈的 sabiston。
You're using a sabiston with no feedback.
然后你会根据反馈的波动来评估一个人。
And then later on you amount a person with the fluctuation in the feedback.
使用此工具,您将能够在不实际更改逻辑的情况下更改机器,只需最终更改一些参数即可,即设备的实际配置。
With this tool, you will be able to change the machine without actually changing the logic and simply by changing a few parameters in the end, the actual configurations of the device.
这将为你的比赛时间节省很多时间。
And this will save your match time a lot of time.
它还将带来一系列我们将在下一个视频中看到的所有功能。
And it will also bring a set of all these features that we will see in the next video.
至此,该装置的实现已经完成。
So the implementation is complete of the device.
然后在下一个视频中,我们将深入探讨折叠检测及其工作原理以及如何在设备中实现这一点。
And then in the next video, we will get deep into the detection of folds and how it works and how to implement this within the device.
之后,我们将拥有一个完整的功能块,可以在我们的主要项目中实现。
And after that, we will have a complete functional block that we can implement in our main projects.